<%@ page import="java.util.List" %>

<%@ taglib uri="/WEB-INF/bpmapp.tld" prefix="ssp" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

<% String ctPath = request.getContextPath(); %>
<jsp:useBean id="docVersionsView" scope="request" type="com.broadvision.web.util.ViewDynaBean"/> 

<script language="javascript">

</script>


<jsp:useBean id="bv_user_logged_in" scope="session" class="java.lang.String" />

<logic:equal name="bv_user_logged_in" value="true">

<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" summary="<bean:message bundle="appCommonRes" key="bp.docVersions.title"/>">
  <tr> 
  <td valign="top" width="100%">
		  
  <div class="pageTitle"><bean:message bundle="appCommonRes" key="bp.docVersions.title"/></div>
  <div class="pageSubtitle">
    <span class="left"><bean:message bundle="appCommonRes" key="bp.docVersions.subtitle"/></span>
    <span class="right">&nbsp;</span>
  </div> 
  
	<div class="blockWrap">
	         
  <table class="labelForm" width="100%" border="0" cellspacing="0" cellpadding="0" summary="<bean:message bundle="appCommonRes" key="bp.docVersions.title"/>">
    <tr>
      <td valign="top" width="25%" class="label"><bean:message bundle="appCommonRes" key="bp.docVersions.name"/>:</td>
      <td valign="top" class="labelField" width="75%"><bean:write name="docVersionsView" property="name"/></td>
    </tr> 
    <tr>
      <td valign="top" width="25%" class="label"><bean:message bundle="appCommonRes" key="bp.docVersions.docType"/>:</td>
      <td valign="top" class="labelField" width="75%"><bean:write name="docVersionsView" property="docType"/></td>
    </tr>     
  </table>
  </div>
	
  <div class="pageSubtitle">
    <span class="left"><bean:message bundle="appCommonRes" key="bp.docVersions.versions.title" /></span>
    <span class="right">&nbsp;</span>
  </div>
  <div class="blockWrap">  
  <table class="dataTable" border="0" cellspacing="1" cellpadding="2" width="100%" summary="<bean:message bundle="appCommonRes" key="bp.docVersions.versions.title" />">
  <tr class="listHeader"> 
    <th id="Content Name" align="left"><bean:message bundle="appCommonRes" key="bp.docVersions.name" /></th>
    <th id="Version" align="left"><bean:message bundle="appCommonRes" key="bp.docVersions.version" /></th>
    <th id="Type" align="left" nowrap><bean:message bundle="appCommonRes" key="bp.docVersions.type" /></th>
    <th id="Modified on" align="left" nowrap><bean:message bundle="appCommonRes" key="bp.docVersions.modifiedOn" /></th>
    <th id="Modified by" align="left" nowrap><bean:message bundle="appCommonRes" key="bp.docVersions.modifiedBy" /></th>
    <th id="Action" align="left" nowrap><bean:message bundle="appCommonRes" key="bp.docVersions.actions" /></th>
  </tr>     

  <logic:iterate id="result" name="docVersionsView" property="versionsList" indexId="index">  
    <tr class='<%=index.intValue() %2 == 0 ? "listEven" : "listOdd"%>'>
      <td headers="Content Name"><bean:write name="result" property="contentName"/></td>
      
      <td headers="Version">
      <logic:equal name="result" property="version" value="-1">
        <bean:message bundle="appCommonRes" key="bp.content.workingCopy"/>
      </logic:equal>
      <logic:notEqual name="result" property="version" value="-1">
        <bean:write name="result" property="version"/>
      </logic:notEqual>
      </td>
      
      <td headers="Type"><bean:write name="result" property="contentObjectType"/></td>
      <td headers="Modified on"><bean:write name="result" property="versionCreatedTime" formatKey="format.datetime.short" /></td>
      <td headers="Modified by"><bean:write name="result" property="versionCreatedBy"/></td>
      <td headers="Action">
      <logic:equal name="docVersionsView" property="viewable" value="Y">
        <a href="<%=ctPath%>/ca/viewDoc.do?action=View&guid=<bean:write name="docVersionsView" property="guid"/>&version=<bean:write name="result" property="version"/>">
        <img src="<%=ctPath%>/ca/images/action/icon_view.gif" width="15" height="15" border="0" class="actionIcon" alt='<bean:message bundle="appCommonRes" key="image.alt.viewDocVer"/>' title='<bean:message bundle="appCommonRes" key="image.alt.viewDocVer"/>'></a>
      </logic:equal>
      <logic:equal name="docVersionsView" property="editable" value="Y">
        <a href="<%=ctPath%>/ca/viewDoc.do?action=Edit&guid=<bean:write name="docVersionsView" property="guid"/>&version=<bean:write name="result" property="version"/>">
        <img src="<%=ctPath%>/ca/images/action/icon_edit.gif" width="15" height="15" border="0" class="actionIcon" alt='<bean:message bundle="appCommonRes" key="image.alt.editDocVer"/>' title='<bean:message bundle="appCommonRes" key="image.alt.editDocVer"/>'></a>
      </logic:equal>
      <logic:equal name="result" property="version" value="-1">
        <a href="<%=ctPath%>/ca/viewDoc.do?action=Edit&guid=<bean:write name="docVersionsView" property="guid"/>&version=<bean:write name="result" property="version"/>">
        <img src="<%=ctPath%>/ca/images/action/icon_edit.gif" width="15" height="15" border="0" class="actionIcon" alt='<bean:message bundle="appCommonRes" key="image.alt.editDocVer"/>' title='<bean:message bundle="appCommonRes" key="image.alt.editDocVer"/>'></a>
      </logic:equal>
      </td>
    </tr>
  </logic:iterate>
  
  </table>  
  </div>
  </td>
  </tr>
</table>

</logic:equal>
